<template>
  <div>
    <!-- 标题 -->
    <van-nav-bar
      title="关注我的人"
      left-arrow
      @click-left="onClickLeft"
    />

    <div class="box">
      <van-row
        v-for="item in $store.state.fans.attention"
        :key="item.id"
        style="margin-top:15px"
      >
        <van-col span="4">
          <van-image
            width="1.2rem"
            height="1.2rem"
            :src="'apis/kuan_api/photo/'+item.user_img"
            fit="contain"
            round
          />
        </van-col>
        <van-col span="18">
          <p class="nickname">{{item.user_nickname}}</p>
        </van-col>
        <van-col
          span="2"
          class="icon"
        >
          <van-icon name="chat-o" />
        </van-col>
      </van-row>
    </div>
  </div>
</template>

<script>
export default {
  name: "fans",
  methods: {
    // 返回上一级
    onClickLeft() {
      window.history.go(-1);
    },
  },
  created() {
    if (this.$store.state.fans == "") {
      this.$store.state.attention = JSON.parse(sessionStorage.getItem("fans"));
    }
    console.log(this.$store.state.fans);
  },
};
</script>

<style scoped>
.icon {
  line-height: 38px;
  font-size: 20px;
}
.box {
  width: 95%;
  margin: 0px auto;
}
.nickname {
  margin: 0;
}
</style>